package com.l.im.strategy;

/**
 * @program: LIM
 * @description: 路由策略
 * @author: Alex Wu
 * @createDate: 2025-04-14 17:54
 **/
import java.util.List;
import java.util.Random;


public class RandomRouteStrategy implements RouteStrategy {
    private final Random random = new Random();

    @Override
    public String getServer(List<String> servers) {
        if (servers == null || servers.isEmpty()) {
            return null;
        }
        return servers.get(random.nextInt(servers.size()));
    }
}
